# This sample code supports Appium Python client >=2.3.0
# pip install Appium-Python-Client
# Then you can paste this into a file and simply run with Python
import time
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy

# For W3C actions
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
from selenium.webdriver.common.actions.pointer_input import PointerInput
class Open:
    def open(self):

        options = AppiumOptions()
        options.load_capabilities({
            "appium:deviceName": "9c45762f",
            "platformName": "Android",
            "appium:platformVersion": "13",
            "appium:appPackage": "com.ss.android.ugc.aweme",
            "appium:appActivity": "com.ss.android.ugc.aweme.splash.SplashActivity",
            # "appium:ensureWebviewsHavePages": True,
            # "appium:nativeWebScreenshot": True,
            "appium:newCommandTimeout": "3600",
            # "appium:connectHardwareKeyboard": True
        })

        driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", options=options)
        return driver